package org.example.aspect;

import lombok.extern.slf4j.Slf4j;
import org.example.annotations.component.Aspect;
import org.example.lib.aop.Handler;
import org.example.lib.aop.IAspect;

@Aspect({"org.example.web.controllers.IndexController", "org.example.services.TestService"})
@Slf4j
public class TestAspect implements IAspect {

    @Override
    public Object handle(Handler handler) {

        log.info("before");
        log.info("args: {}", handler.getArgs());

        Object res = handler.handle();

        log.info("res: {}", res);

        return res;
    }
}
